import "../../../scss/user_page/user_center.scss";
import $ from "jquery";
import Vue from "vue"
import "../../utils/remove_ad";
import "../../utils/oldcommon/layer";
import moment from "moment";
import com from "../../utils/common";
/* 判断是否分享朋友圈等相关信息  */

$(function() {

  let page = {
    _appData:{
      ExpireTime:  "2018-10-11 20:12:21",
      Organization:"星河子机构",
      Mobile: "18322803026",
      limitcheck: true
    },
    _app:{},
    _init:function () {
      let self = this;
      com.ajax({
        url:"/user/UserCenterMsg",
        ok:function(data){
          console.log(data);
          let centerData = data["msg"];
          console.log(centerData);
          $.extend(self._appData,centerData);
          self._loadTemp();
        }
      })
    },
    _loadTemp:function (){
      let self = this;
      self._app = new Vue({
        el: "#app",
        data: self._appData,
        computed: {
          ExpireDay: function() {
            let  LimitDay = this.ExpireTime;
            return moment(LimitDay).format("YYYY-MM-DD");
          },
          OverTime: function() {
            let limitDays = moment(this.ExpireDay).diff(moment(), 'days');
            console.log(this.limitcheck)
            if(limitDays > 0){
              return limitDays;
            }else{
              this.limitcheck = false;
            }
          },
        }
      });
    }
  }
  page._init()
});
